importPackage(org.argouml.model);
importPackage(org.argouml.kernel);
importPackage(org.argouml.uml.diagram.static_structure.ui);
importPackage(org.omg.uml.foundation.datatypes);
 
_pm = ProjectManager.getManager();
_p = _pm.getCurrentProject();
_m = _p.getModel();
_m.setName("ModelXUML");
_cf = Model.getCoreFactory();
_pc = _p.getProfileConfiguration();
_dtf = Model.getDataTypesFactory();
_clf = Model.getCollaborationsFactory();
_coh = Model.getCollaborationsHelper();


c = _cf.buildClass("A", _m);

ty = _pc.findType("Integer");

a = _cf.buildAttribute2(c, ty);
a.setName("x");

ex = _dtf.createExpression("", "3");
a.setInitialValue(ex);

col = _clf.buildCollaboration(_m);
col.setName("ModelDinstancies");
clr = _clf.buildClassifierRole(col);
clr.setName("#a1");
_coh.addBase(clr, c);

clr2 = _clf.buildClassifierRole(col);
clr2.setName("#a2");
_coh.addBase(clr2, c);

asr = _clf.buildAssociationRole(clr, clr2);
asr.setName("#te1(#a1, #a2)");
